package com.wiz.vo.to.lamicpay;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

/**
 * 莱米req数据
 * @author Hakeny
 */
public class LamicReqData extends LamicBaseData {
//	private static final long serialVersionUID = 6724851620602139099L;
	
	private String uid;// 客户在莱米系统的账号
	private String pwd;// 账号对应的密码
	private String token;// 登录接口返回token
	private String code;// 交易串码-支付码
	private String money;// 订单金额，单位为元，精确到分
	private String rsv1;// 扩展参数1,暂时null
	private String rsv2;// 扩展参数2,暂时null
	private String out_trade_no;// 调用支付接口返回的交易流水号
	private String orderid;// 调用支付接口返回的交易流水号
	private String retmoneypwd;// 商户退款密码
	private String rebatesMoney;// 退款金额，精确到分

	public List<NameValuePair> toFormParamsList(){
    	List<NameValuePair> formparams=new ArrayList<NameValuePair>();
        Field[] fields = this.getClass().getDeclaredFields();
        for (Field field : fields) {
            Object obj;
            try {
                obj = field.get(this);
                if(obj!=null){
                    formparams.add(new BasicNameValuePair(field.getName(), String.valueOf(obj)));
                }
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
        return formparams;
    }
	
	public String toEncryptParams(){
		StringBuffer sb = new StringBuffer();
        Field[] fields = this.getClass().getDeclaredFields();
        for (Field field : fields) {
            Object obj;
            try {
                obj = field.get(this);
                if(obj!=null){
                    sb.append(field.getName()).append(";,`").append(String.valueOf(obj)).append("`,;");
                }
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
        return sb.toString();
    }
	
	public LamicReqData(){
	}
	
	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMoney() {
		return money;
	}

	public void setMoney(String money) {
		this.money = money;
	}

	public String getRsv1() {
		return rsv1;
	}

	public void setRsv1(String rsv1) {
		this.rsv1 = rsv1;
	}

	public String getRsv2() {
		return rsv2;
	}

	public void setRsv2(String rsv2) {
		this.rsv2 = rsv2;
	}

	public String getOut_trade_no() {
		return out_trade_no;
	}

	public void setOut_trade_no(String out_trade_no) {
		this.out_trade_no = out_trade_no;
	}

	public String getOrderid() {
		return orderid;
	}

	public void setOrderid(String orderid) {
		this.orderid = orderid;
	}

	public String getRetmoneypwd() {
		return retmoneypwd;
	}

	public void setRetmoneypwd(String retmoneypwd) {
		this.retmoneypwd = retmoneypwd;
	}

	public String getRebatesMoney() {
		return rebatesMoney;
	}

	public void setRebatesMoney(String rebatesMoney) {
		this.rebatesMoney = rebatesMoney;
	}

}
